import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
import { AbstractSelectConfig } from './abstract-select-config';
import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
import { Helper } from '../../../tool/helper';


/**
 * 节点对象选择配置
 */
class TransformNodeSelectConfig extends AbstractSelectConfig<TransformNode>{

    public test(target: TransformNode): boolean {
        return target instanceof TransformNode;
    }

    public compare(a: TransformNode, b: TransformNode): boolean {
        return a.id === b.id;
    }

    public meshes(target: TransformNode): AbstractMesh[] {
        return Helper.getChildMeshes(target);
    }

    public isMeshOfTarget(mesh: AbstractMesh, target: TransformNode): number {
        return Helper.isChild(mesh, target);
    }

}


export { TransformNodeSelectConfig };